<?php
class navMod extends commonMod
{
	
	 //位置导航
    public function category($pid,$limit)
    {
    
		$data=$this->model->field('cid,pid,name,enname,url')->table('category')->where("pid=$pid")->limit($limit)->select();
		if($data){
			foreach($data as &$val)
			{
				$val['url']	= __APP__.'/show/'.$val['enname'];
				
				$val['url']	=$val['url'];
			}
			return $data;
		}
    }
	
	//显示页面
	public function show()
	{
		$id=intval($_GET[0]);//文章id
		if(empty($id))
		{
			$this->error('参数传递有误');
		}
		$condition['id']=$id;
    	$info=$this->model->table('content')->where($condition)->find();
		$info['content']=html_out($info['content']);
		$this->assign('info',$info);
		$this->display('show');
	}
}
?>